package com.czwj.service.impl;

import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.czwj.dao.AuthorityMapper;
import com.czwj.entities.Authority;
import com.czwj.service.AuthorityService;

/**
* @ClassName: AuthorityServiceImpl
* @Description: TODO
* @author H
* @date 2020年4月10日
*
*/
@Service
public class AuthorityServiceImpl implements AuthorityService{
	@Resource
	AuthorityMapper mapper;
	/** 
	* 
	* @param rpParams
	* @return
	* @see com.czwj.service.AuthorityService#search(java.util.Map)
	*/
	@Override
	public List<Authority> search(Map<String,Object> rpParams){
		// TODO Auto-generated method stub
		return this.mapper.search(rpParams);
	}
	
	/** 
	* 
	* @param levelPer
	* @return
	* @see com.czwj.service.AuthorityService#add(com.czwj.entities.Authority)
	*/
	@Override
	public int add(Authority levelPer){
		// TODO Auto-generated method stub
		return this.mapper.insertSelective(levelPer);
	}
	
	/** 
	* 
	* @param id
	* @return
	* @see com.czwj.service.AuthorityService#delete(java.lang.Integer)
	*/
	@Override
	public int delete(Integer id){
		// TODO Auto-generated method stub
		return this.mapper.deleteByPrimaryKey(id);
	}

	/** 
	* 
	* @param levelId
	* @see com.czwj.service.AuthorityService#deleteByLevelId(int)
	*/
	@Override
	public void deleteByLevelId(int levelId){
		// TODO Auto-generated method stub
		this.mapper.deleteByLevelId(levelId);
	}

	/** 
	* 
	* @param authority2
	* @see com.czwj.service.AuthorityService#insert(com.czwj.entities.Authority)
	*/
	@Override
	public void insert(Authority authority2){
		// TODO Auto-generated method stub
		this.mapper.insertSelective(authority2);
	}
}
